use bevy::{prelude::*, render::render_resource::{AsBindGroup, ShaderRef}};


pub const SHADER_ASSET_PATH_TIME_VAR: &str = "shaders/animate_shader.wgsl";
pub const SHADER_ASSET_PATH_INSTANCE: &str = "shaders/automatic_instancing.wgsl";

// 
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
pub struct CustomMaterialEmpty {}

impl Material for CustomMaterialEmpty {
    fn fragment_shader() -> ShaderRef {
        SHADER_ASSET_PATH_TIME_VAR.into()
    }
}

// 
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
pub struct CustomMaterialImage {
    #[texture(0)]
    #[sampler(1)]
    pub image: Handle<Image>,
}

impl Material for CustomMaterialImage {
    fn vertex_shader() -> ShaderRef {
        SHADER_ASSET_PATH_INSTANCE.into()
    }

    fn fragment_shader() -> ShaderRef {
        SHADER_ASSET_PATH_INSTANCE.into()
    }
}